Skip to content

fix(licensing): remove token tamper flake#385

Merged
blove merged 1 commit into
mainfrom
codex/fix-licensing-test-flake
May 17, 2026
Merged

fix(licensing): remove token tamper flake#385
blove merged 1 commit into
mainfrom
codex/fix-licensing-test-flake

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 17, 2026

Summary

Fixes the flaky licensing:test by making the tampered-token fixture deterministic.

Root Cause

run-license-check.spec.ts generated a tampered token with validToken.slice(0, -1) + 'x'. Because the token is random base64url, that sometimes left the token unchanged or changed only unused trailing base64 bits in the unpadded signature segment. In those cases the decoded signature remained valid, so runLicenseCheck() correctly returned licensed instead of tampered.

Change

Mutate the first character of the signature segment instead, where every bit affects the decoded signature, and assert that the generated tampered token differs from the original.

Verification

  • Reproduced the original flake locally in 8 direct Vitest runs.
  • 20x direct licensing Vitest coverage runs passed after the fix.
  • nx test licensing --coverage --skip-nx-cache passed.
  • nx run-many -t test --projects=chat,langgraph,ag-ui,render,a2ui,licensing,telemetry --coverage --skip-nx-cache passed.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 17, 2026 2:53am

Request Review

@blove blove merged commit 04a7337 into main May 17, 2026
16 checks passed
@blove blove deleted the codex/fix-licensing-test-flake branch May 17, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant